/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import GUI.FUNCTION.CUSTOMER.FunctionAddCustomer;
import GUI.FUNCTION.CUSTOMER.FunctionFindCustomer;
import GUI.FUNCTION.PASSBOOK.FunctionAddPassBook;
import GUI.FUNCTION.PASSBOOK.FunctionFindPassBook;
import GUI.MENULIST.MenuListCustomer;
import GUI.MENULIST.MenuListHome;
import GUI.MENULIST.MenuListPassBook;
import GUI.MENULIST.MenuListReport;
import GUI.MENULIST.MenuListTruthBill;
import GUI.MAINMENU.MenuCustomer;
import GUI.MAINMENU.Home;
import GUI.MAINMENU.Home;
import GUI.MAINMENU.MenuPassBook;
import GUI.MAINMENU.MenuReport;
import GUI.MAINMENU.MenuTruthBill;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Image;
import java.awt.Toolkit;
import java.beans.PropertyVetoException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.border.Border;
import javax.swing.event.MouseInputListener;
import org.jdesktop.swingx.JXFrame;
import org.jdesktop.swingx.JXPanel;

/**
 *
 * @author wonka
 */
public class Main extends org.jdesktop.swingx.JXFrame{
private static JXPanel workPanelChild =null;
    /**
     * Creates new form Main
     */
    Toolkit tk=Toolkit.getDefaultToolkit();
    public Main() {
        initComponents();
        Container  main = this.getContentPane();
        main.setBackground(new Color(231,254,245));
        setPreferredSize(new Dimension((int)tk.getScreenSize().getWidth(),(int) tk.getScreenSize().getHeight()));
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        Panel_Function = new org.jdesktop.swingx.JXPanel();
        jXPanel3 = new org.jdesktop.swingx.JXPanel();
        bt_Exit = new org.jdesktop.swingx.JXButton();
        bt_Logout1 = new org.jdesktop.swingx.JXButton();
        Panel_Work = new org.jdesktop.swingx.JXPanel();
        jXPanel5 = new org.jdesktop.swingx.JXPanel();
        bt_Report = new org.jdesktop.swingx.JXButton();
        bt_Home1 = new org.jdesktop.swingx.JXButton();
        bt_Customer = new org.jdesktop.swingx.JXButton();
        bt_PassBook1 = new org.jdesktop.swingx.JXButton();
        bt_TruthBill1 = new org.jdesktop.swingx.JXButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenu5 = new javax.swing.JMenu();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenuItem13 = new javax.swing.JMenuItem();
        jMenuItem14 = new javax.swing.JMenuItem();
        jMenu6 = new javax.swing.JMenu();
        jMenuItem6 = new javax.swing.JMenuItem();
        jMenuItem8 = new javax.swing.JMenuItem();
        jMenuItem11 = new javax.swing.JMenuItem();
        jMenuItem12 = new javax.swing.JMenuItem();
        jMenu7 = new javax.swing.JMenu();
        jMenuItem9 = new javax.swing.JMenuItem();
        jMenuItem10 = new javax.swing.JMenuItem();
        jMenuItem19 = new javax.swing.JMenuItem();
        jMenuItem15 = new javax.swing.JMenuItem();
        jMenuItem16 = new javax.swing.JMenuItem();
        jMenu8 = new javax.swing.JMenu();
        jMenuItem17 = new javax.swing.JMenuItem();
        jMenuItem18 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem21 = new javax.swing.JMenuItem();
        jMenuItem22 = new javax.swing.JMenuItem();
        jMenuItem23 = new javax.swing.JMenuItem();
        jMenuItem24 = new javax.swing.JMenuItem();
        jMenu9 = new javax.swing.JMenu();
        jMenuItem20 = new javax.swing.JMenuItem();
        jMenu10 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("QUẢN LÝ TIỀN GỬI TIẾT KIỆM");
        setBackground(new java.awt.Color(231, 254, 245));
        setBounds(new java.awt.Rectangle(0, 0, 1366, 768));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setWaitPaneVisible(true);
        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentShown(java.awt.event.ComponentEvent evt) {
                formComponentShown(evt);
            }
        });
        addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                formMouseMoved(evt);
            }
        });

        Panel_Function.setBackground(new java.awt.Color(255, 253, 218));
        Panel_Function.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder(null, "Chức Năng", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 3, 10)), "Danh Mục", javax.swing.border.TitledBorder.LEADING, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 3, 14), new java.awt.Color(255, 102, 0))); // NOI18N
        Panel_Function.addContainerListener(new java.awt.event.ContainerAdapter() {
            public void componentAdded(java.awt.event.ContainerEvent evt) {
                Panel_FunctionComponentAdded(evt);
            }
        });

        javax.swing.GroupLayout Panel_FunctionLayout = new javax.swing.GroupLayout(Panel_Function);
        Panel_Function.setLayout(Panel_FunctionLayout);
        Panel_FunctionLayout.setHorizontalGroup(
            Panel_FunctionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 253, Short.MAX_VALUE)
        );
        Panel_FunctionLayout.setVerticalGroup(
            Panel_FunctionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 235, Short.MAX_VALUE)
        );

        jXPanel3.setBackground(new java.awt.Color(255, 253, 218));
        jXPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        bt_Exit.setBackground(new java.awt.Color(0, 168, 222));
        bt_Exit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Medium_Close.png"))); // NOI18N
        bt_Exit.setText("Thoát");
        bt_Exit.setFocusPainted(false);
        bt_Exit.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        bt_Exit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_ExitActionPerformed(evt);
            }
        });

        bt_Logout1.setBackground(new java.awt.Color(0, 168, 222));
        bt_Logout1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Medium_Logout.png"))); // NOI18N
        bt_Logout1.setText("Đăng Xuất");
        bt_Logout1.setFocusPainted(false);
        bt_Logout1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);

        javax.swing.GroupLayout jXPanel3Layout = new javax.swing.GroupLayout(jXPanel3);
        jXPanel3.setLayout(jXPanel3Layout);
        jXPanel3Layout.setHorizontalGroup(
            jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel3Layout.createSequentialGroup()
                .addGap(46, 46, 46)
                .addComponent(bt_Logout1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 359, Short.MAX_VALUE)
                .addComponent(bt_Exit, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(43, 43, 43))
        );
        jXPanel3Layout.setVerticalGroup(
            jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(bt_Exit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(bt_Logout1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        Panel_Work.setBackground(new java.awt.Color(255, 253, 218));
        Panel_Work.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        Panel_Work.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentResized(java.awt.event.ComponentEvent evt) {
                Panel_WorkComponentResized(evt);
            }
        });
        Panel_Work.addContainerListener(new java.awt.event.ContainerAdapter() {
            public void componentAdded(java.awt.event.ContainerEvent evt) {
                Panel_WorkComponentAdded(evt);
            }
        });

        javax.swing.GroupLayout Panel_WorkLayout = new javax.swing.GroupLayout(Panel_Work);
        Panel_Work.setLayout(Panel_WorkLayout);
        Panel_WorkLayout.setHorizontalGroup(
            Panel_WorkLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        Panel_WorkLayout.setVerticalGroup(
            Panel_WorkLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );

        jXPanel5.setBackground(new java.awt.Color(255, 253, 218));
        jXPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        bt_Report.setBackground(new java.awt.Color(255, 255, 102));
        bt_Report.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Medium_Report.png"))); // NOI18N
        bt_Report.setText("BÁO CÁO");
        bt_Report.setFocusPainted(false);
        bt_Report.setFont(new java.awt.Font("Tahoma", 3, 11)); // NOI18N
        bt_Report.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        bt_Report.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_ReportActionPerformed(evt);
            }
        });

        bt_Home1.setBackground(new java.awt.Color(0, 238, 230));
        bt_Home1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Medium_Home.png"))); // NOI18N
        bt_Home1.setText("MÀN HÌNH CHÍNH");
        bt_Home1.setFocusPainted(false);
        bt_Home1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        bt_Home1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_Home1ActionPerformed(evt);
            }
        });

        bt_Customer.setBackground(new java.awt.Color(204, 248, 47));
        bt_Customer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Medium_Customer.png"))); // NOI18N
        bt_Customer.setText("KHÁCH HÀNG");
        bt_Customer.setFocusPainted(false);
        bt_Customer.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        bt_Customer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_CustomerActionPerformed(evt);
            }
        });

        bt_PassBook1.setBackground(new java.awt.Color(255, 0, 102));
        bt_PassBook1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Medium_PassBook.png"))); // NOI18N
        bt_PassBook1.setText("SỐ TIẾT KIỆM");
        bt_PassBook1.setFocusPainted(false);
        bt_PassBook1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        bt_PassBook1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_PassBook1ActionPerformed(evt);
            }
        });

        bt_TruthBill1.setBackground(new java.awt.Color(255, 114, 2));
        bt_TruthBill1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Medium_Bills.png"))); // NOI18N
        bt_TruthBill1.setText("TÍN PHIẾU");
        bt_TruthBill1.setFocusPainted(false);
        bt_TruthBill1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        bt_TruthBill1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_TruthBill1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jXPanel5Layout = new javax.swing.GroupLayout(jXPanel5);
        jXPanel5.setLayout(jXPanel5Layout);
        jXPanel5Layout.setHorizontalGroup(
            jXPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jXPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jXPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(bt_PassBook1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bt_Report, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bt_TruthBill1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bt_Customer, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bt_Home1, javax.swing.GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE))
                .addContainerGap())
        );
        jXPanel5Layout.setVerticalGroup(
            jXPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jXPanel5Layout.createSequentialGroup()
                .addContainerGap(101, Short.MAX_VALUE)
                .addComponent(bt_Home1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(bt_Customer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(bt_PassBook1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(bt_TruthBill1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addComponent(bt_Report, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jMenuBar1.setBackground(new java.awt.Color(255, 251, 238));

        jMenu1.setForeground(new java.awt.Color(204, 0, 0));
        jMenu1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Small_List.png"))); // NOI18N
        jMenu1.setText("Danh Mục");

        jMenuItem3.setBackground(new java.awt.Color(228, 244, 249));
        jMenuItem3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_ListCustomer.png"))); // NOI18N
        jMenuItem3.setText("Danh Sách Khách Hàng");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem3);

        jMenuItem1.setBackground(new java.awt.Color(249, 245, 220));
        jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_ListPassBook.png"))); // NOI18N
        jMenuItem1.setText("Danh Sách Sổ Tiết Kiệm");
        jMenu1.add(jMenuItem1);

        jMenuItem2.setBackground(new java.awt.Color(238, 248, 250));
        jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_ListBills.png"))); // NOI18N
        jMenuItem2.setText("Danh Sách Tài Khoản Tín Phiếu");
        jMenu1.add(jMenuItem2);

        jMenuBar1.add(jMenu1);

        jMenu5.setForeground(new java.awt.Color(204, 0, 0));
        jMenu5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Small_Customer.png"))); // NOI18N
        jMenu5.setText("Khách Hàng");

        jMenuItem4.setBackground(new java.awt.Color(255, 233, 208));
        jMenuItem4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_FindCustomer.png"))); // NOI18N
        jMenuItem4.setText("Tra Cứu Khách Hàng");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        jMenu5.add(jMenuItem4);

        jMenuItem5.setBackground(new java.awt.Color(255, 249, 191));
        jMenuItem5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_AddCustomer.png"))); // NOI18N
        jMenuItem5.setText("Tiếp Nhận Khách Hàng");
        jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem5ActionPerformed(evt);
            }
        });
        jMenu5.add(jMenuItem5);

        jMenuItem13.setBackground(new java.awt.Color(216, 235, 208));
        jMenuItem13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_BorrowBill.png"))); // NOI18N
        jMenuItem13.setText("Lập Phiếu Vay");
        jMenu5.add(jMenuItem13);

        jMenuItem14.setBackground(new java.awt.Color(223, 242, 246));
        jMenuItem14.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_PayBill.png"))); // NOI18N
        jMenuItem14.setText("Lập Phiếu Thanh Toán");
        jMenu5.add(jMenuItem14);

        jMenuBar1.add(jMenu5);

        jMenu6.setForeground(new java.awt.Color(204, 0, 0));
        jMenu6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Small_PassBook.png"))); // NOI18N
        jMenu6.setText("Sổ Tiết Kiệm");

        jMenuItem6.setBackground(new java.awt.Color(251, 226, 237));
        jMenuItem6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_FindPassBook.png"))); // NOI18N
        jMenuItem6.setText("Tra Cứu Sổ Tiết Kiệm");
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem6ActionPerformed(evt);
            }
        });
        jMenu6.add(jMenuItem6);

        jMenuItem8.setBackground(new java.awt.Color(255, 249, 191));
        jMenuItem8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_AddPassBook.png"))); // NOI18N
        jMenuItem8.setText("Mở Sổ");
        jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem8ActionPerformed(evt);
            }
        });
        jMenu6.add(jMenuItem8);

        jMenuItem11.setBackground(new java.awt.Color(182, 221, 194));
        jMenuItem11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_DepositBill.png"))); // NOI18N
        jMenuItem11.setText("Lập Phiếu Gửi");
        jMenu6.add(jMenuItem11);

        jMenuItem12.setBackground(new java.awt.Color(255, 233, 208));
        jMenuItem12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_GetBill.png"))); // NOI18N
        jMenuItem12.setText("Lập Phiếu Rút");
        jMenu6.add(jMenuItem12);

        jMenuBar1.add(jMenu6);

        jMenu7.setForeground(new java.awt.Color(204, 0, 0));
        jMenu7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_AddBills.png"))); // NOI18N
        jMenu7.setText("Tín Phiếu");

        jMenuItem9.setBackground(new java.awt.Color(255, 233, 208));
        jMenuItem9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_FindBills.png"))); // NOI18N
        jMenuItem9.setText("Tra Cứu Tín Phiếu");
        jMenu7.add(jMenuItem9);

        jMenuItem10.setBackground(new java.awt.Color(251, 226, 237));
        jMenuItem10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_AddBills.png"))); // NOI18N
        jMenuItem10.setLabel("Mở Tài Khoản Tín Phiếu");
        jMenu7.add(jMenuItem10);

        jMenuItem19.setBackground(new java.awt.Color(228, 244, 249));
        jMenuItem19.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_BuyBill.png"))); // NOI18N
        jMenuItem19.setText("Lập Phiếu Mua");
        jMenu7.add(jMenuItem19);

        jMenuItem15.setBackground(new java.awt.Color(182, 221, 194));
        jMenuItem15.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_SellBill.png"))); // NOI18N
        jMenuItem15.setText("Lập Phiếu Bán");
        jMenu7.add(jMenuItem15);

        jMenuItem16.setBackground(new java.awt.Color(228, 244, 249));
        jMenuItem16.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_TransferBill.png"))); // NOI18N
        jMenuItem16.setText("Lập Phiếu Chuyển Nhượng");
        jMenu7.add(jMenuItem16);

        jMenuBar1.add(jMenu7);

        jMenu8.setForeground(new java.awt.Color(204, 0, 0));
        jMenu8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Small_Report.png"))); // NOI18N
        jMenu8.setText("Báo Cáo");

        jMenuItem17.setBackground(new java.awt.Color(236, 223, 237));
        jMenuItem17.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_SubReport.png"))); // NOI18N
        jMenuItem17.setText("Lập Báo Cáo Công Nợ");
        jMenu8.add(jMenuItem17);

        jMenuItem18.setBackground(new java.awt.Color(251, 226, 237));
        jMenuItem18.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_SubReport.png"))); // NOI18N
        jMenuItem18.setText("Lập Báo Cáo Giao Dịch");
        jMenu8.add(jMenuItem18);

        jMenuBar1.add(jMenu8);

        jMenu2.setForeground(new java.awt.Color(204, 0, 0));
        jMenu2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Small_Update.png"))); // NOI18N
        jMenu2.setText("Cập Nhật Phần Mềm");

        jMenuItem21.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_Update.png"))); // NOI18N
        jMenuItem21.setText("Thêm Loại Tiết Kiệm");
        jMenuItem21.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem21ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem21);

        jMenuItem22.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_Update.png"))); // NOI18N
        jMenuItem22.setText("Thêm Loại Tín Phiếu");
        jMenuItem22.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem22ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem22);

        jMenuItem23.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_Update.png"))); // NOI18N
        jMenuItem23.setText("Thêm Loại Tiền");
        jMenuItem23.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem23ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem23);

        jMenuItem24.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/VerySmall_Update.png"))); // NOI18N
        jMenuItem24.setText("Thay Đổi Quy Định");
        jMenuItem24.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem24ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem24);

        jMenuBar1.add(jMenu2);

        jMenu9.setForeground(new java.awt.Color(204, 0, 0));
        jMenu9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Small_System.png"))); // NOI18N
        jMenu9.setText("Hệ Thống");

        jMenuItem20.setText("Thêm Người Dùng");
        jMenuItem20.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem20ActionPerformed(evt);
            }
        });
        jMenu9.add(jMenuItem20);

        jMenuBar1.add(jMenu9);

        jMenu10.setForeground(new java.awt.Color(204, 0, 0));
        jMenu10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Small_Help.png"))); // NOI18N
        jMenu10.setText("Giúp Đỡ");
        jMenuBar1.add(jMenu10);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(Panel_Function, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jXPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jXPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(Panel_Work, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(13, 13, 13)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(Panel_Work, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jXPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(Panel_Function, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jXPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void bt_CustomerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_CustomerActionPerformed
        // TODO add your handling code here:
        AddPanel(Panel_Work, new MenuCustomer());
        AddPanel(Panel_Function, new MenuListCustomer());
    }//GEN-LAST:event_bt_CustomerActionPerformed

    private void bt_ExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_ExitActionPerformed
        // TODO add your handling code here:
      
        this.dispose();
    }//GEN-LAST:event_bt_ExitActionPerformed

    private void bt_Home1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_Home1ActionPerformed
        // TODO add your handling code here:
        AddPanel(Panel_Work, new Home());
        AddPanel(Panel_Function,new MenuListHome());
    }//GEN-LAST:event_bt_Home1ActionPerformed

    private void Panel_WorkComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_Panel_WorkComponentResized
        // TODO add your handling code here:
        Component c = Panel_Work.getComponent(0);
        c.resize(Panel_Work.getSize());
        c.setPreferredSize(Panel_Work.getPreferredSize());
        c.revalidate();
        c.repaint();
        //Panel_Work.getComponent(0).setPreferredSize(Panel_Work.getPreferredSize());
    }//GEN-LAST:event_Panel_WorkComponentResized

    private void bt_PassBook1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_PassBook1ActionPerformed
        // TODO add your handling code here:
        AddPanel(Panel_Work,new MenuPassBook());
        AddPanel(Panel_Function, new MenuListPassBook());
    }//GEN-LAST:event_bt_PassBook1ActionPerformed

    private void bt_TruthBill1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_TruthBill1ActionPerformed
        // TODO add your handling code here:
         AddPanel(Panel_Work,new MenuTruthBill());
         AddPanel(Panel_Function, new MenuListTruthBill());
    }//GEN-LAST:event_bt_TruthBill1ActionPerformed

    private void bt_ReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_ReportActionPerformed
        // TODO add your handling code here:
        AddPanel(Panel_Work,new MenuReport());
        AddPanel(Panel_Function, new MenuListReport());
    }//GEN-LAST:event_bt_ReportActionPerformed

    private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
    try {
        // TODO add your handling code here:
        AddPanel(Panel_Work, new FunctionAddCustomer());
    } catch (Exception ex) {
        Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    }
        AddPanel(Panel_Function, new MenuListCustomer());
    }//GEN-LAST:event_jMenuItem5ActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
    try {
        // TODO add your handling code here:
        AddPanel(Panel_Work, new FunctionFindCustomer());
        AddPanel(Panel_Function, new MenuListCustomer());
    } catch (Exception ex) {
        Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    }
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMenuItem20ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem20ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem20ActionPerformed

    private void jMenuItem21ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem21ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem21ActionPerformed

    private void jMenuItem22ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem22ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem22ActionPerformed

    private void jMenuItem23ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem23ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem23ActionPerformed

    private void jMenuItem24ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem24ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem24ActionPerformed

    private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
        // TODO add your handling code here:
        AddPanel(Panel_Function, new MenuListHome());
    }//GEN-LAST:event_formComponentShown

    private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
    try {
        // TODO add your handling code here:
        AddPanel(Panel_Work, new FunctionAddPassBook());
        AddPanel(Panel_Function, new MenuListPassBook());
    } catch (Exception ex) {
        Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    }
    }//GEN-LAST:event_jMenuItem8ActionPerformed

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
        // TODO add your handling code here:
          AddPanel(Panel_Work, new FunctionFindPassBook());
         AddPanel(Panel_Function, new MenuListPassBook());
    }//GEN-LAST:event_jMenuItem6ActionPerformed

    private void Panel_WorkComponentAdded(java.awt.event.ContainerEvent evt) {//GEN-FIRST:event_Panel_WorkComponentAdded
        // TODO add your handling code here:
        
    }//GEN-LAST:event_Panel_WorkComponentAdded

    private void formMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseMoved
        // TODO add your handling code here:
        if(workPanelChild!=null){
            AddPanel(Panel_Work,workPanelChild);
            workPanelChild =null;
        }
    }//GEN-LAST:event_formMouseMoved

    private void Panel_FunctionComponentAdded(java.awt.event.ContainerEvent evt) {//GEN-FIRST:event_Panel_FunctionComponentAdded
        // TODO add your handling code here:
//          if(workPanelChild!=null){
//            AddPanel(Panel_Work,workPanelChild);
//            workPanelChild =null;
//        }
    }//GEN-LAST:event_Panel_FunctionComponentAdded

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
    
        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Main().setVisible(true);
            }
        });
    }
    
    public void  AddPanel(JXPanel parent, JXPanel child){
          if(parent.getComponentCount() >0)
        {
           parent.removeAll();;
           parent.revalidate();
           parent.repaint();
        }
         child.setSize(parent.getSize());
         child.setPreferredSize(parent.getPreferredSize());
         child.setVisible(true);
         parent.add(child);
         parent.revalidate();
         parent.repaint();
         
    }
    public static void setWorkPanelChild(JXPanel panel){
        workPanelChild = panel;
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private org.jdesktop.swingx.JXPanel Panel_Function;
    private org.jdesktop.swingx.JXPanel Panel_Work;
    private org.jdesktop.swingx.JXButton bt_Customer;
    private org.jdesktop.swingx.JXButton bt_Exit;
    private org.jdesktop.swingx.JXButton bt_Home1;
    private org.jdesktop.swingx.JXButton bt_Logout1;
    private org.jdesktop.swingx.JXButton bt_PassBook1;
    private org.jdesktop.swingx.JXButton bt_Report;
    private org.jdesktop.swingx.JXButton bt_TruthBill1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu10;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenu jMenu6;
    private javax.swing.JMenu jMenu7;
    private javax.swing.JMenu jMenu8;
    private javax.swing.JMenu jMenu9;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem10;
    private javax.swing.JMenuItem jMenuItem11;
    private javax.swing.JMenuItem jMenuItem12;
    private javax.swing.JMenuItem jMenuItem13;
    private javax.swing.JMenuItem jMenuItem14;
    private javax.swing.JMenuItem jMenuItem15;
    private javax.swing.JMenuItem jMenuItem16;
    private javax.swing.JMenuItem jMenuItem17;
    private javax.swing.JMenuItem jMenuItem18;
    private javax.swing.JMenuItem jMenuItem19;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem20;
    private javax.swing.JMenuItem jMenuItem21;
    private javax.swing.JMenuItem jMenuItem22;
    private javax.swing.JMenuItem jMenuItem23;
    private javax.swing.JMenuItem jMenuItem24;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JMenuItem jMenuItem9;
    private org.jdesktop.swingx.JXPanel jXPanel3;
    private org.jdesktop.swingx.JXPanel jXPanel5;
    // End of variables declaration//GEN-END:variables
}
